/* 基本重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 头部样式 */
header {
    background-color: #333;
    color: white;
    padding: 2rem 0;
    text-align: center;
    position: relative;
}

nav ul {
    list-style: none;
    margin-top: 1rem;
}

nav ul li {
    display: inline;
    margin: 0 1rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #4CAF50;
}

/* 主内容区样式 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 3rem;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4CAF50;
}

/* 项目网格样式 */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-item {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.project-item h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
}

/* 关于我内容样式 */
.about-content {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.profile-img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #4CAF50;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 技能标签样式 */
.skills-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.skill-tag:hover {
    transform: translateY(-2px);
}

.skill-tag.expert {
    background-color: #4CAF50;
    color: white;
}

.skill-tag.proficient {
    background-color: #2196F3;
    color: white;
}

.skill-tag.beginner {
    background-color: #FF9800;
    color: white;
}

/* 个人成就样式 */
.achievements-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.achievements-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.achievement-item:hover {
    transform: translateY(-2px);
}

.achievement-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.achievement-text h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.achievement-text p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* 时间线样式 */
.timeline-container {
    position: relative;
    padding-left: 2rem;
    margin-top: 1rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #4CAF50;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #4CAF50;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #4CAF50;
}

.timeline-date {
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.timeline-content h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.2rem;
}

.timeline-content p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* 项目图片样式 */
.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.project-item:hover .project-img {
    transform: scale(1.05);
}

/* 语言切换器样式 */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 5px;
    z-index: 1000;
    border: 2px solid #4CAF50;
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: #4CAF50;
    color: white;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .language-switcher {
        top: 0.5rem;
        right: 1rem;
        padding: 0.3rem;
    }
    
    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* 原神作品集样式 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.gallery-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-img:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 联系方式样式 */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form-container {
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.submit-button {
    background-color: #4CAF50;
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #45a049;
}

.contact-info {
    margin-top: 1.5rem;
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
}

.contact-info p {
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
}

.contact-info strong {
    color: #4CAF50;
    min-width: 80px;
    display: inline-block;
}

.contact-info a {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: #1976D2;
    text-decoration: underline;
}

/* 计算器样式 */
.calculator-container {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f0f0f0;
    border-radius: 8px;
}

/* 计算器弹出窗口样式 */
.calculator-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.calculator-popup.active {
    opacity: 1;
    visibility: visible;
}

.calculator-popup-content {
    background-color: white;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.calculator-popup.active .calculator-popup-content {
    transform: scale(1);
}

.calculator-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #333;
    color: white;
}

.calculator-popup-header h4 {
    margin: 0;
    font-size: 18px;
}

.calculator-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.calculator-popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.calculator {
    max-width: 250px;
    margin: 0 auto;
    background-color: #333;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.calculator-display {
    width: 100%;
    height: 60px;
    background-color: #222;
    color: white;
    font-size: 28px;
    text-align: right;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calculator-button {
    height: 50px;
    font-size: 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #555;
    color: white;
    transition: background-color 0.3s ease;
}

.calculator-button:hover {
    background-color: #777;
}

.calculator-button.operation {
    background-color: #4CAF50;
}

.calculator-button.operation:hover {
    background-color: #66BB6A;
}

.calculator-button.equal {
    background-color: #FF9800;
}

.calculator-button.equal:hover {
    background-color: #FFB74D;
}

.calculator-button.clear {
    background-color: #F44336;
}

.calculator-button.clear:hover {
    background-color: #EF5350;
}

.calculator-button.zero {
    grid-column: span 2;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav ul li {
        display: block;
        margin: 0.5rem 0;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 1.5rem;
    }
    
    .contact-info strong {
        min-width: auto;
    }
    
    .calculator {
        max-width: 200px;
    }
    
    .calculator-button {
        height: 45px;
        font-size: 18px;
    }
}